package org.yray.sip.time;

import lombok.Data;
import org.yray.sip.receive.BasePacketDispatch;
import org.yray.sip.server.SipServerHandler;
import org.yray.sip.utils.IcspBeanHolder;

@Data
public abstract class BaseSendTask implements Comparable<BaseSendTask> {

    protected long time;

    @Override
    public int compareTo(BaseSendTask o) {
        return (int)(time-o.time);
    }

    public abstract void doJob();


    public BasePacketDispatch getBasePacketDispatch()
    {
        return IcspBeanHolder.getBean(BasePacketDispatch.class);
    }
    public SipServerHandler getSipServerHandler()
    {
        return IcspBeanHolder.getBean(SipServerHandler.class);
    }

}
